package aom.ju.ss.view.user.set

import android.content.Intent
import android.view.View
import aom.ju.ss.R
import aom.ju.ss.databinding.SetActivityBinding
import aom.ju.ss.lpInterface.TitleDialogInterface
import aom.ju.ss.mode.UserInfo
import aom.ju.ss.utils.start
import aom.ju.ss.view.base.BaseActivity
import aom.ju.ss.view.dialog.TitleDialog
import aom.ju.ss.view.main.LoginActivity
import aom.ju.ss.view.user.AddressListActivity


class SetActivity : BaseActivity() {
    private lateinit var binding: SetActivityBinding
    override fun init() {
        binding = viewBinding as SetActivityBinding
        binding.info = UserInfo.userInfo
        binding.infoLay.setOnClickListener { start(UserInfoActivity::class.java) }
        binding.qrLay.setOnClickListener { start(MyQrCodeActivity::class.java) }
        binding.addressLay.setOnClickListener {start(AddressListActivity::class.java,"1") }
        binding.accLay.setOnClickListener { }
        binding.idLay.setOnClickListener { }
        binding.txLay.setOnClickListener { }
        binding.tjLay.setOnClickListener { }
        binding.yjLay.setOnClickListener { }
        binding.abLay.setOnClickListener { }

        binding.out.setOnClickListener {

            TitleDialog().show(this, object : TitleDialogInterface {
                override fun ok(view: View?, IsDetermine: Boolean) {
                    if (!IsDetermine) return

                    val intent: Intent = Intent(
                        activity,
                        LoginActivity::class.java
                    ).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
                    startActivity(intent)

                }

            }).setConnect("确定退出登录?")
                .tvCancel("    取消    ")
                .tvDetermine("退出登录")


        }
    }

    override val lay: Int = R.layout.set_activity

}